<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">


        <div class="form-group">

            <div class="col-xs-12 col-sm-10">
                <table class="table fieldlist" data-template="basictpl" data-name="games_json" id="first-table">
                    <tr>
                        <td>{:__('名称')}</td>
                        <td>{:__('URL')}</td>
                        <td>{:__('状态')}</td>
                        <td width="100"></td>
                    </tr>
                    <tr>
                        <td colspan="5"><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i
                                class="fa fa-plus"></i> {:__('Append')}</a></td>
                    </tr>
                </table>

                <!--请注意实际开发中textarea应该添加个hidden进行隐藏-->
                <textarea name="games_json" class="form-control hidden" cols="30" rows="5">{$games}</textarea>
                <script id="basictpl" type="text/html">
                    <tr class="form-inline">
                        <td><input type="text" name="<%=name%>[<%=index%>][game_short_name]" class="form-control" size="5"
                                   value="<%=row.game_short_name%>" placeholder="短名称"/></td>

                        <td><input type="text" name="<%=name%>[<%=index%>][url]" class="form-control" size="20"
                                   value="<%=row.url%>" placeholder="URL"/>
                        </td>
                        <td>
                            <input type="hidden" name="<%=name%>[<%=index%>][state]" id="c-state-<%=index%>"
                                   class="form-control" style="width:50px" value="<%=row.state|1%>" placeholder="状态"/>
                            <a href="javascript:;" data-toggle="switcher" class="btn-switcher"
                               data-input-id="c-state-<%=index%>" data-yes="1" data-no="0">
                                <i class="fa fa-toggle-on text-success <%if(row.state==0){%>fa-flip-horizontal text-gray<%}%> fa-2x"></i>
                            </a>
                        </td>
                        <td>
                            <!--下面的两个按钮务必保留-->
                            <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
                            <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
                        </td>
                    </tr>
                </script>
            </div>
        </div>

        <div class="form-group layer-footer">
            <label class="control-label col-xs-12 col-sm-2"></label>
            <div class="col-xs-12 col-sm-8">
                <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            </div>
        </div>
</form>
